-- GENERATED SPELL FOR [Westguard Officer] --


function spell0_23844(pUnit, Event) --@Defensive Stance,Self--
pUnit:FullCastSpellOnTarget(7164,pUnit)
pUnit:RegisterEvent('Sorts_23844', 556, 1)
end

function spell1_23844(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(16244,pUnit)
pUnit:RegisterEvent('Sorts_23844', 30334, 1)
end

function spell2_23844(pUnit, Event) --@Improved Blocking,Self--
pUnit:FullCastSpellOnTarget(3639,pUnit)
pUnit:RegisterEvent('Sorts_23844', 6280, 1)
end

function Sorts_23844(pUnit, Event)
local choix_sorts_23844 = math.random(0, 2)
if choix_sorts_23844 == 0 then
pUnit:RegisterEvent('spell0_23844', 1, 1)
end
if choix_sorts_23844 == 1 then
pUnit:RegisterEvent('spell1_23844', 1, 1)
end
if choix_sorts_23844 == 2 then
pUnit:RegisterEvent('spell2_23844', 1, 1)
end
end

function mob23844_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23844', math.random(1500, 3000), 1)
end

function mob23844_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23844_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23844_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23844, 1, 'mob23844_Action')
RegisterUnitEvent(23844, 2, 'mob23844_Leave')
RegisterUnitEvent(23844, 3, 'mob23844_Kill')
RegisterUnitEvent(23844, 4, 'mob23844_Die')
